<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
  "http://colorer.sf.net/2003/hrc.dtd">
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">


    <type name="yaml">
        <annotation>
            <contributors>
                Eugene Myronchuk
            </contributors>
            <appinfo>
                <prototype name="yaml" group="rare" description="YAML">
                    <location link="rare/yaml.hrc"/>
                    <filename weight="10">/\.(yml)$/</filename>
                </prototype>
            </appinfo>
            <documentation>
                Yaml files highlighting
            </documentation>
        </annotation>
        <import type="def"/>
		<entity name="byte" value="\d{1,2}|[01]\d\d|2[0-4]\d|25[0-5]" />
		<entity name="word" value="\d{1,4}|[0-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]" />

		<region name="KeyName" parent="def:Keyword"/>
		<region name="DocumentStart" parent="def:Symbol"/>
		<region name="DocumentEnd" parent="def:Symbol"/>
		<region name="Tag" parent="def:EMail"/>
		<region name="TagEdge" parent="def:Tag"/>
		<region name="IP" parent="def:EMail"/>

		<scheme name="Escapes">
			<regexp match="/\\[0\\abtnvfre&quot;N_Lp]/" region="def:SymbolStrong" />
			<regexp match="/\\x[\da-fA-F]{2}/" region="def:SymbolStrong" />
			<regexp match="/\\u[\da-fA-F]{4}/" region="def:SymbolStrong" />
			<regexp match="/\\U[\da-fA-F]{8}/" region="def:SymbolStrong" />

			<!--regexp match="/\\./" region="def:Error" /-->
		</scheme>
		<scheme name="Numbers">
			<regexp match="/(^|\s)?#1\b-?\d+(\.\d+)?\b/" region="def:Number"/>
		</scheme>
		<scheme name="Date">
			<inherit scheme="def:Date"/>
		</scheme>
		<scheme name="Strings">
		    <inherit scheme="Escapes"/>
			<regexp match="/(%byte;)(?{def:Symbol}\.)(%byte;)(?{def:Symbol}\.)(%byte;)(?{def:Symbol}\.)(%byte;)((?{def:SymbolStrong}:)(%word;))?/" region="IP" />
			<regexp match="/%[\w\._]+%/" region="def:Constant" />
			<inherit scheme="Date" />
			<inherit scheme="def:Time" />
		    <inherit scheme="def:NetAddresses" />
		    <inherit scheme="Numbers" />
		</scheme>

        <scheme name="Comments">
        	<regexp match="/#.*$/" region="def:Comment"/>
        </scheme>

        <scheme name="Keys">
			<regexp match="/([\w\.\:\-]+)\M:(\s|$)?=/" region1="KeyName" />
        </scheme>

        <scheme name="Brackets">
        	<block start="/(\[)/" end="/(\])/" scheme="YamlBody"
        		region00="def:PairStart"  region10="def:PairEnd"
        		region01="def:SymbolStrong" region11="def:SymbolStrong"
        	/>
        	<block start="/(\{)/" end="/(\})/" scheme="YamlBody"
        		region00="def:PairStart"        region10="def:PairEnd"
        		region01="def:SymbolStrong" region11="def:SymbolStrong"
        	/>
        	<keywords region="def:Error">
        		<symb name="]"/>
        		<symb name="}"/>
        	</keywords>
        </scheme>
        <scheme name="Tags">
            <regexp match="/!h?\!\w+/" region="def:Directive" />
        	<regexp match="/!&lt;[^&gt;]+&gt;/"
        		region="def:Directive"
        	/>
        </scheme>
        <scheme name="Scalars">
        	<keywords region="def:Keyword" ignorecase="yes">
        		<word name="~"/>
        		<word name="false"/>
        		<word name="N"/>
        		<word name="No"/>
        		<word name="null"/>
        		<word name="true"/>
        		<word name="Y"/>
        		<word name="Yes"/>
        		<word name=".inf"/>
        		<word name="-.inf"/>
        		<word name=".NaN"/>
        	</keywords>
        </scheme>
        
        <scheme name="YamlBody">
        	<inherit scheme="Comments"/>
			<inherit scheme="Tags" />
			<inherit scheme="def:Time" />
        	<inherit scheme="Keys"/>
        	<inherit scheme="Scalars"/>
        	<regexp match="/[&amp;*]\w+/" region="def:Var" />
        	<regexp match="/[|?&gt;!%&amp;`@]($|\s)?=/" region="def:Symbol" />
        	<inherit scheme="Brackets"/>
        	<block start="/([&apos;&quot;])/" end="/(\Y1)/" scheme="Strings"
        		region="def:String"
        		region00="def:PairStart"  region10="def:PairEnd"
        		region01="def:StringEdge" region11="def:StringEdge"
        	/>
        	<block start="/[^\s,:?;-]?=/" end="/[,\[\]\{\}#&apos;&quot;]?=|(^\.{3})?=|$/" scheme="Strings"
        		region="def:String"
        	/>
        	<regexp match="/[\?:,\[\]\{\}#&amp;\*!|&gt;&apos;&quot;%@`\-]/" region="def:Symbol" priority="low"/>
        </scheme>
        
        <scheme name="yaml">
            <block start="/^(-{3})(\s|$)?=/" end="/^(\.{3}|(-{3})?=)/" scheme="YamlBody"
            	region00="def:PairStart" region10="def:PairEnd"
            	region01="DocumentStart" region11="DocumentEnd"
            />
        	<inherit scheme="YamlBody"/>
        </scheme>
    </type>

</hrc>
